<?php
header('Content-Type:text/html;charset=gbk');
if(!defined('APP_NAME')){
    exit('need APP_NAME');
}
defined('DEV_MODE') or define('DEV_MODE', 'product');//[product, dev]
define('PATH_ROOT', __DIR__ . '/');
define('PATH_COM', PATH_ROOT . 'com/');
define('PATH_SITE', PATH_ROOT . 'sites/' . SITE_NAME . '/');

include(PATH_ROOT . 'com/dk/core/Loader.php');
include(PATH_ROOT . 'com/function/common.php');
$loader = loader()->getLoader();

$loader->add('common', PATH_ROOT . 'com');
$loader->add('dk', PATH_ROOT . 'com');
$loader->add('sp', PATH_COM . 'vendor');

if(isDev()){
    include(PATH_ROOT . 'com/function/debug.php');
}

if(defined('SITE_NAME') && SITE_NAME){
    define('PATH_APP', PATH_SITE . 'app/' . APP_NAME . '/');
    $loader->add('action', PATH_APP);
    $configFile = isDev() ? 'config_dev.php' : 'config.php';

    C()->loadFile(PATH_SITE . 'config/' . $configFile);
    loader()->myAutoLoad(C('autoload'));
}

//��ȡapp ��config ���г�ʼ��
/*
step1. ��ȡ�����ļ�
step2. �ϲ��ļ�
*/